package com.fxz.oauth.domain.dto;

import com.fxz.oauth.annotation.PasswordMatch;
import com.fxz.oauth.annotation.ValidEmail;
import com.fxz.oauth.annotation.ValidPassword;
import com.fxz.oauth.util.Constants;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @author Fxz
 * @version 1.0
 * @date 2021-08-03 16:19
 */
@PasswordMatch
@Data
public class UserDto implements Serializable {
    @NotNull
    @NotBlank
    @Size(min = 4, max = 50, message = "用户名长度在4~50个字符之间")
    private String username;
    @NotNull
    @ValidPassword
    private String password;
    private String matchingPassword;
    @NotNull
    @ValidEmail
    private String email;
    @Pattern(regexp = Constants.PATTERN_MOBILE)
    @NotNull
    private String mobile;
    @NotNull
    @NotBlank
    @Size(min = 3, max = 50, message = "姓名长度在3~50个字符之间")
    private String name;
}
